From f4f73e3b22b654f61a5bab4f299cc237f1818c09 Mon Sep 17 00:00:00 2001 From: Andres Lagar-Cavilla Date: Thu, 1 Dec 2011 14:56:43 +0000 Subject: [PATCH] x86/mm: Allow pages typed as log dirty to also be shared Signed-off-by: Andres Lagar-Cavilla Acked-by: Tim Deegan Committed-by: Tim Deegan --- xen/arch/x86/mm/mem_sharing.c | 3 +++ xen/include/asm-x86/p2m.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index e2e5be2ea3..30e84c5d5e 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -697,6 +697,9 @@ private_page_found: /* Update m2p entry */ set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), gfn); + /* Now that the gfn<->mfn map is properly established, + * marking dirty is feasible */ + paging_mark_dirty(d, mfn_x(page_to_mfn(page))); put_gfn(d, gfn); shr_unlock(); return 0; diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index 7a900bf12f..581cd81552 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -163,7 +163,8 @@ typedef enum { /* Shared types */ /* XXX: Sharable types could include p2m_ram_ro too, but we would need to * reinit the type correctly after fault */ -#define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw)) +#define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw) \ + | p2m_to_mask(p2m_ram_logdirty) ) #define P2M_SHARED_TYPES (p2m_to_mask(p2m_ram_shared)) /* Broken type: the frame backing this pfn has failed in hardware -- 2.30.2